package vn.allmobile.newsreader;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Picture;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.aphidmobile.flip.FlipViewController;

public class NewsDetailActivity extends Activity {
	protected FlipViewController flipView;
	WebView mWeb;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// flipView = new FlipViewController(this, FlipViewController.VERTICAL);
		//
		// WebView mWebView = new WebView(getApplicationContext());
		// String mCustomHtml = "<h1>Test 0</h1></br>";
		// for (int i = 1; i < 100; i++) {
		// mCustomHtml += "<h1>Test " + String.valueOf(i) + "</h1></br>";
		// }
		// mWebView.loadData(mCustomHtml, "text/html; charset=UTF-8", null);
		// try {
		// Thread.sleep(3000);
		// } catch (InterruptedException e) {
		// // TODO Auto-generated catch block
		// e.printStackTrace();
		// }
		// NewsDetailAdapter adapter = new NewsDetailAdapter(mWebView);
		// flipView.setAdapter(adapter);
		// setContentView(flipView);

		// setContentView(R.layout.news_detail);
		mWeb = new WebView(getApplicationContext());
		mWeb.setWebViewClient(new WebViewClient() {

			@Override
			public void onPageFinished(WebView view, String url) {
				Picture picture = view.capturePicture();
				Bitmap b = Bitmap.createBitmap(picture.getWidth(),
						picture.getHeight(), Bitmap.Config.ARGB_8888);

			}

		});
		// mWeb.loadData(mCustomHtml, "text/html; charset=UTF-8", null);
		mWeb.loadUrl("http://google.com.vn");
		setContentView(mWeb);
		// mWeb = (WebView) this.findViewById(R.id.webView);
	}

	@Override
	public void onWindowFocusChanged(boolean hasFocus) {
		// TODO Auto-generated method stub
		super.onWindowFocusChanged(hasFocus);
	}
}
